package org.lanqiao.webfm.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;
import java.io.Serializable;
import java.sql.*;
import java.lang.reflect.*;

import javacommon.base.*;
import javacommon.ijdbc.*;
import javacommon.util.*;
import javacommon.web.page.*;

import org.lanqiao.webfm.model.*;

import org.slf4j.*;

/**
*@Author zhengwei
**/
public class Type extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	//date formats
	//columns START
	/**id**/
	private Long id;
	/**名称**/
	private java.lang.String name;
	/**描述**/
	private java.lang.String descp;
	/**父级分类**/
	private Long pid;
	//columns END

	public Type(){
	}

	public Type(Long id){
		this.id = id;
	}

	public void setId(Long value) {
		this.id = value;
	}
	/**id**/
	public Long getId() {
		return this.id;
	}
	public void setName(java.lang.String value) {
		this.name = value;
	}
	/**名称**/
	public java.lang.String getName() {
		return this.name;
	}
	public void setDescp(java.lang.String value) {
		this.descp = value;
	}
	/**描述**/
	public java.lang.String getDescp() {
		return this.descp;
	}
	public void setPid(Long value) {
		this.pid = value;
	}
	/**父级分类**/
	public Long getPid() {
		return this.pid;
	}
	
	private Set goodss = new HashSet(0);
	public void setGoodss(Set goods){
		this.goodss = goods;
	}
	
	public Set getGoodss() {
		return goodss;
	}
	
	private Set types = new HashSet(0);
	public void setTypes(Set type){
		this.types = type;
	}
	
	public Set getTypes() {
		return types;
	}
	
	private Type type;
	
	public void setType(Type type){
		this.type = type;
	}
	
	public Type getType() {
		if (type==null) {
			type=new Type();
		}
		return type;
	}
	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Name",getName())
			.append("Descp",getDescp())
			.append("Pid",getPid())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Type == false) return false;
		if(this == obj) return true;
		Type other = (Type)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

